package net.wofly.sale.exchange.dao.impl;

import net.wofly.sale.exchange.dao.IExchangeConsumeDao;
import net.wofly.sale.exchange.domain.ExchangeConsume;
import net.wofly.sale.exchange.repository.ExchangeConsumeRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class ExchangeConsumeDaoImpl implements IExchangeConsumeDao {

	@Autowired
	ExchangeConsumeRepository repository;

	@Override
	public ExchangeConsume save(ExchangeConsume entity) {
		return repository.save(entity);
	}

	@Override
	public void delete(ExchangeConsume entity) {
		repository.delete(entity);
	}

	@Override
	public void delete(String key) {
		repository.delete(key);
	}

	@Override
	public ExchangeConsume findOne(String key) {
		return repository.findOne(key);
	}

	@Override
	public List<ExchangeConsume> save(List<ExchangeConsume> entityList) {
		return (List<ExchangeConsume>) repository.save(entityList);
	}

}
